<template>
  <el-table :data="questions" style="width: 100%">
    <el-table-column prop="id" label="ID" width="60"/>
    <el-table-column prop="content" label="题目内容"/>
    <el-table-column prop="type" label="题型"/>
    <el-table-column prop="score" label="分值"/>
    <el-table-column label="操作" width="180">
      <template #default="scope">
        <el-button size="mini" @click="edit(scope.row)">编辑</el-button>
        <el-button size="mini" type="danger" @click="remove(scope.row)">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  data() {
    return {
      questions: [
        { id: 1, content: '2+2=？', type: '单选', score: 2 },
        { id: 2, content: '地球是圆的吗？', type: '判断', score: 1 }
      ]
    }
  },
  methods: {
    edit(row) {
      this.$router.push(`/questions/edit/${row.id}`)
    },
    remove(row) {
      // 删除逻辑
    }
  }
}
</script> 